<?php
function addSupplement($name, $description, $idSystem){
	
	$unique = "SELECT * FROM supplement WHERE name='$name'";
	$query = mysql_query("$unique") or die(mysql_error());
	$query = mysql_fetch_array($query, MYSQL_BOTH);
	
	$q_name = strtolower($query['name']);
	$l_name = strtolower($name);

	if($q_name == $l_name){
		echo("j&aacute; existe um suplemento com este nome, favor escolher outro.<br />");
	}else{
		$q = "INSERT INTO supplement(name,description,idSystem) VALUES('$name','$description','$idSystem');";
		$query = mysql_query("$q") or die(mysql_error());
		return true;
	}
}
?>